package com.medusa.aps.business.modules.basic.model.input;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

/**
 * @author 张治保
 * @since 2023/10/8
 */
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = "workingDay")
@Accessors(chain = true)
@Schema(description = "工作日与工作时段关联参数")
public class WorkingDayPeriodParam implements Comparable<WorkingDayPeriodParam> {

    /**
     * 工作日 1-7 分表代表周一到周日
     */
    @Range(min = 1, max = 7, message = "工作日取值范围为1-7")
    @Schema(title = "工作日", description = "可选值 1-7 分表代表周一到周日", example = "1")
    private Integer workingDay;

    /**
     * 工作时段id
     */
    @NotNull(message = "工作时段id不能为空")
    @Schema(title = "工作时段id", description = "工作时段id，休息传 0", example = "22")
    private Integer periodId;


    @Override
    public int compareTo(@org.jetbrains.annotations.NotNull WorkingDayPeriodParam other) {
        return this.workingDay.compareTo(other.workingDay);
    }
}
